package com.zegome.game.gomestory.main.scene.play.board;

import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.zegome.game.entity.sprite.BaseSprite;

public class PikaEat extends BaseSprite{

	Board board;
	int type;
	
	public PikaEat(Board board, int type) {
		super(50, 50);
		setSize(58, 58);
		setOrigin(29,29);
		this.type = type;
		this.board = board;
	}

	@Override
	public void onDraw(final SpriteBatch pSpriteBatch, final float pAlpha) {
		if (!isVisible)
			return;
		
		pSpriteBatch.setColor(mColor.r, mColor.g, mColor.b, mColor.a * pAlpha);
				
		if (mScaleX == 1 && mScaleY == 1 && mRotation == 0){
			pSpriteBatch.draw(board.screen.ctr.a.squareRegion[board.dataMap.squarePress], mX, mY, mWidth, mHeight);			
			pSpriteBatch.draw(board.img.pika[type], mX, mY, mWidth, mHeight);								
			
		}
		else {
			pSpriteBatch.draw(board.screen.ctr.a.squareRegion[board.dataMap.squarePress], mX, mY, mOriginX, mOriginY, mWidth, mHeight,
				mScaleX, mScaleY, mRotation);
			pSpriteBatch.draw(board.img.pika[type], mX, mY, mOriginX, mOriginY, mWidth, mHeight,
					mScaleX, mScaleY, mRotation);
		}
	}
}
